home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / emstools.arc / EMMLIB.ARC / EMM02_A.ASM < prev    next >
Assembly Source File  |  1990-02-04  |  4KB  |  85 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM02_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_page_frame_seg                                      ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns the segment of the LIM page       ;
  7. ;                     frame.  The LIM page frame defines a region of memory   ;
  8. ;                     above 640K that is AT LEAST four CONTIGUOUS 16K-byte    ;
  9. ;                     (64K) blocks in length.  In other words, the page       ;
  10. ;                     frame defines a region into which AT LEAST four 16K     ;
  11. ;                     pages can be mapped.  You can determine the actual      ;
  12. ;                     length of the region using the                          ;
  13. ;                     get_mappable_region_count function (EMMLIB38.ASM).      ;
  14. ;                                                                             ;
  15. ;           PASSED:   &page_frame-seg:                                        ;
  16. ;                        is a far pointer to the segment address of the LIM   ;
  17. ;                        page frame.                                          ;
  18. ;                                                                             ;
  19. ;         RETURNED:   status:                                                 ;
  20. ;                        is the status EMM returns from the call.  All other  ;
  21. ;                        returned results are valid only if the status        ;
  22. ;                        returned is zero.  Otherwise they are undefined.     ;
  23. ;                                                                             ;
  24. ;                     page_frame_seg:                                         ;
  25. ;                        is the segment address of the page frame.            ;
  26. ;                                                                             ;
  27. ; C USE CONVENTION:   unsigned int status;                                    ;
  28. ;                     unsigned int page_frame_seg;                            ;
  29. ;                                                                             ;
  30. ;                     status = get_page_frame_seg (&page_frame_seg);          ;
  31. ;-----------------------------------------------------------------------------;
  32. .XLIST
  33. PAGE    60,132
  34.  
  35. IFDEF SMALL
  36.    .MODEL SMALL, C
  37. ENDIF
  38. IFDEF MEDIUM
  39.    .MODEL MEDIUM, C
  40. ENDIF
  41. IFDEF LARGE
  42.    .MODEL LARGE, C
  43. ENDIF
  44. IFDEF COMPACT
  45.    .MODEL COMPACT, C
  46. ENDIF
  47. IFDEF HUGE
  48.    .MODEL HUGE, C
  49. ENDIF
  50.  
  51. INCLUDE emmlib.equ
  52. INCLUDE emmlib.str
  53. INCLUDE emmlib.mac
  54. .LIST
  55. .CODE
  56.  
  57. get_page_frame_seg    PROC                                                  \
  58.             ptr_page_frame_seg:FAR PTR WORD
  59.  
  60.     ;---------------------------------------------------------------------;
  61.     ;   do;                                                               ;
  62.     ;   .   get page frame segment from EMM;                              ;
  63.     ;---------------------------------------------------------------------;
  64.     MOVE        AH, get_page_frame_fcn
  65.     INT         EMM_int
  66.  
  67.     ;---------------------------------------------------------------------;
  68.     ;   .   convert the page frame segment into a far pointer             ;
  69.     ;   .   and pass it back to the caller;                               ;
  70.     ;---------------------------------------------------------------------;
  71.     MOVE        DX, BX
  72.     MOVE        ES:BX, ptr_page_frame_seg
  73.     MOVE        ES:[BX], DX
  74.  
  75.     ;---------------------------------------------------------------------;
  76.     ;   .   return (EMM status);                                          ;
  77.     ;   end;                                                              ;
  78.     ;---------------------------------------------------------------------;
  79.     RET_EMM_STAT    AH
  80.  
  81. get_page_frame_seg    ENDP
  82.  
  83. PAGE
  84. END
  85.